use "ESS.dta", clear
 
 
set scheme s1mono, permanent

global controls "Female Citizen trend  i.essround"
global FE "i.yrbrn i.Country"
 
replace Income=Income/10
g Stf=stfmjob/10
 
 

quietly eststo m1: reg Income Bologna $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm1= e(N)
su  Income if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm1=trim("`Mean'")


quietly eststo m2: reg Income2 Bologna $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm2= e(N)
su  Income2 if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm2=trim("`Mean'")

quietly eststo m3: reg Job Bologna $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm3= e(N)
su  Job if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm3=trim("`Mean'")


quietly eststo m4: reg Stf  Bologna  $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm4= e(N)
su  Stf  if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm4=trim("`Mean'")

*set scheme s1mono
 
 
	   grstyle init
	 grstyle set legend 2,  nobox
	 grstyle set size 8pt: tick_label key_label
	 grstyle set size 12pt: heading
	 grstyle set size 10pt: subheading axis_title
	grstyle set color    "0 0 0" "80 80 80" "130 130 130" "180 180 180" "220 220 220" 
    grstyle set graphsize 13cm 10.5cm 	
	coefplot (m1, label( "{bf:Income}" "decile" ) ) (m2, label("{bf:Income}" "subjective") )  (m3, label("{bf:Job quality}" "ISCO"))  (m4, label("{bf:Job quality}" "subjective")),     keep( Bologna)   xscale(range(-0.05,0.05)) xlab(-0.05(.02)0.05, grid gstyle(minor))   xline(0,  lpattern(dash)  )   msymbol(o)  levels(95) ciopts(recast(. rcap))  xtitle("Reform effect", size(medsmall))    ylabel("",angle(vertical) labsize(medsmall))  legend(position(12) rows(1) span  size(small))  baselevels     title("{bf:(a) Income and status}")  note("{bf:Income decile}: Net household income decile | {it:N}=`Nm1' | Mean = `Meanm1'."  "{bf:Income subjective}: How well you cope with your income | {it:N}=`Nm2' | Mean = `Meanm2'." "{bf:Job quality ISCO}: ISCO-based occupational prestige scale | {it:N}=`Nm3' | Mean = `Meanm3'."  "{bf:Job quality subjective}: How satisfied with job | {it:N}=`Nm4' | Mean = `Meanm4'." , size(vsmall) span)
graph export "Figure5a.png", replace 
 

quietly eststo m1: reg Unemployed Bologna $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm1= e(N)
su  Unemployed if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm1=trim("`Mean'")

quietly eststo m2: reg Self Bologna $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm2= e(N)
su  Self if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm2=trim("`Mean'")

 
quietly eststo m3: reg Skill_spec Bologna $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm3= e(N)
su  Skill_spec if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm3=trim("`Mean'")

 
quietly eststo m5: reg Hours  Bologna  $controls $FE  if University==1 & short==1, vce(cluster Country)
local Nm5= e(N)
su  Hours2 if e(sample), mean
loc Mean:di%8.2fc r(mean)
loc Meanm5=trim("`Mean'")

 
 
	   grstyle init
	 grstyle set legend 2,  nobox
	 grstyle set size 8pt: tick_label key_label
	 grstyle set size 12pt: heading
	 grstyle set size 10pt: subheading axis_title
	grstyle set color    "0 0 0" "80 80 80" "130 130 130" "180 180 180" "220 220 220" 
    grstyle set graphsize 13cm 10.5cm 	
	coefplot (m1, label( "{bf:Unemployment}" "status" ) ) (m2, label("{bf:Self-employed}" "status") )   (m3, label("{bf:Skill specificity}" "relative"))   (m5, label("{bf:Labour supply}" "hours worked")),     keep( Bologna)   xscale(range(-0.05,0.05)) xlab(-0.05(.02)0.05, grid gstyle(minor))   xline(0,  lpattern(dash)  )   msymbol(o)  levels(95) ciopts(recast(. rcap))  xtitle("Reform effect", size(medsmall))    ylabel("",angle(vertical) labsize(medsmall))  legend(position(12) rows(1) span  size(small))  baselevels     title("{bf:(b) Employment and skills}")  note( "{bf:Unemployment}: Dummy variable | {it:N}=`Nm1' | Mean = `Meanm1'." "{bf:Self-employed}: Dummy variable | {it:N}=`Nm2' | Mean = `Meanm2'."  "{bf:Skill specificity}: see text | {it:N}=`Nm3' | Mean = `Meanm3'." "{bf:Labour supply}: Weekly numbers of hours worked | {it:N}=`Nm5' | Mean = `Meanm5'." , size(vsmall) span)
graph export "Figure5b.png", replace 

